import _ from 'lodash'

const files = require.context('.', false, /\.js$/)
const modules = {
	//data
	state: {
		tabberName: "home"
	},
	// computed
	getters: {
		getTabbarName(store) {
			return store.tabberName
		}
	},
	// methods同步处理
	mutations: {
		setTabbarName(state, tabberName) {
			state.tabberName = tabberName;
		}
	},
	// methods异步处理
	actions: {}
}

files.keys().forEach(key => {
	if (key === './index.js') return
	_.mergeWith(modules, files(key).default)
})

export default modules
